﻿<UserControl x:Class="SharpMap.Wpf.MapViewInfoPanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cnv="http://schemas.kent.boogaart.com/converters"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    >
    <UserControl.Resources>
        <ResourceDictionary>
            <cnv:MapConverter x:Key="_boolToVisibleConverter">
                <cnv:Mapping To="{x:Static Visibility.Visible}">
                    <cnv:Mapping.From>
                        <sys:Boolean>True</sys:Boolean>
                    </cnv:Mapping.From>
                </cnv:Mapping>
                <cnv:Mapping To="{x:Static Visibility.Collapsed}">
                    <cnv:Mapping.From>
                        <sys:Boolean>False</sys:Boolean>
                    </cnv:Mapping.From>
                </cnv:Mapping>
                <cnv:Mapping From="{x:Static Visibility.Visible}">
                    <cnv:Mapping.To>
                        <sys:Boolean>True</sys:Boolean>
                    </cnv:Mapping.To>
                </cnv:Mapping>
                <cnv:Mapping From="{x:Static Visibility.Collapsed}">
                    <cnv:Mapping.To>
                        <sys:Boolean>False</sys:Boolean>
                    </cnv:Mapping.To>
                </cnv:Mapping>
            </cnv:MapConverter>
        </ResourceDictionary>
    </UserControl.Resources>
    <UserControl.ContextMenu>
        <ContextMenu>
            <MenuItem Header="_ViewSize" x:Name="_viewSizeMenu" IsCheckable="True" IsChecked="True"/>
            <MenuItem Header="_World Width / Height" x:Name="_worldWidthHeightMenu" IsCheckable="True" IsChecked="True"/>
            <MenuItem Header="View _Envelope" x:Name="_envelopeMenu"   IsCheckable="True" IsChecked="True"/>
            <MenuItem Header="Geo_Center" x:Name="_geoCenterMenu"   IsCheckable="True" IsChecked="True"/>

        </ContextMenu>
    </UserControl.ContextMenu>
    <StatusBar DockPanel.Dock="Bottom">
        <StatusBar.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapPanel IsItemsHost="True"/>
            </ItemsPanelTemplate>
        </StatusBar.ItemsPanel>
        
        <StatusBarItem x:Name="_ViewSize"
             Visibility="{Binding ElementName=_viewSizeMenu, Path=IsChecked, Converter={StaticResource _boolToVisibleConverter}  }">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="ViewSize: "/>
                    <TextBlock Text="{Binding Path=ViewSize}"/>
                </StackPanel>
        </StatusBarItem>
        <Separator/>

        <StatusBarItem x:Name="_worldWidthHeight" 
                       Visibility="{Binding ElementName=_worldWidthHeightMenu, Path=IsChecked, Converter={StaticResource _boolToVisibleConverter}  }">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="WorldWidth: "/>
                <TextBlock Text="{Binding  Path=WorldWidth}"/>
                <TextBlock Text=", WorldHeight: "/>
                 <TextBlock Text="{Binding Path=WorldHeight}"/>                    
             </StackPanel>
        </StatusBarItem>
        <Separator/>
        <StatusBarItem x:Name="_envelpoe"
                       Visibility="{Binding ElementName=_envelopeMenu, Path=IsChecked, Converter={StaticResource _boolToVisibleConverter}  }">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="ViewEnvelpoe: "/>
                    <TextBlock Text="{Binding Path=ViewEnvelope}"/>
                </StackPanel>
        </StatusBarItem>
        <StatusBarItem x:Name="_geoCenter"
            Visibility="{Binding ElementName=_geoCenterMenu, Path=IsChecked, Converter={StaticResource _boolToVisibleConverter}  }">

            <StackPanel Orientation="Horizontal">
                <TextBlock Text="GeoCenter: "/>
                <TextBlock Text="{Binding Path=GeoCenter}"/>
              
            </StackPanel>
            
        </StatusBarItem>
                       
                       
     </StatusBar>
  
</UserControl>
